﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DataObjectLayer
{
    public class CategoryItemDOL
    {
        public const string Select = @"SELECT Test.Category.CategoryTitle, Test.Category.CategoryID, Test.CategoryItem.CategoryItemID, Test.CategoryItem.CategoryItemTitle, Test.CategoryItem.Description FROM Test.CategoryItem INNER JOIN Test.Category ON Test.CategoryItem.CategoryID = Test.Category.CategoryID";
        public const string Insert = @"INSERT INTO TEST.CATEGORYITEM( CATEGORYITEMTITLE,DESCRIPTION) VALUES (@CategoryItemTitle,@DescriptionL)";
        public const string SelectComboBox = @"SELECT CATEGORYITEMID, CATEGORYITEMTITLE FROM TEST.CATEGORYITEM UNION (SELECT VALUE AS CATEGORYITEMID, TEXT AS CATEGORYITEMTITLE FROM Common.NOSELECTION)";
        public const string Delete = "DELETE FROM TEST.CATEGORYITEM WHERE CATEGORYITEMID=@CategoryItemId";
        public const string Update = "UPDATE TEST.CATEGORYITEM SET CATEGORYITEMTITLE = @CategoryItemTitle ,DESCRIPTION = @Description WHERE CATEGORYITEMID = @CategoryItemId";
        public const string SelectMaxId = "SELECT ISNULL(MAX(CATEGORYITEMID),0)+1 AS MAX_CATEGORYITEM_ID FROM TEST.CATEGORYITEM";
        public enum QueryStatus { Select,SelectComboBox, Insert, Delete, Update, SelectMaxId };
    }
}
